/* 简历模板页面样式 */

/* 页面头部 */
.page-header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    padding: var(--spacing-xl) 0;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.page-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: url('../images/pattern-dots.svg');
    opacity: 0.1;
    pointer-events: none;
}

.page-header h1 {
    margin-bottom: var(--spacing-sm);
    font-size: 2.5rem;
    font-weight: 700;
    position: relative;
}

.page-header p {
    font-size: 1.125rem;
    opacity: 0.9;
    margin-bottom: 0;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

/* 筛选器 */
.template-filters {
    background-color: var(--background-color);
    border-bottom: 1px solid var(--border-color);
    padding: var(--spacing-lg) 0;
    position: sticky;
    top: 64px;
    z-index: 90;
    box-shadow: var(--shadow-sm);
}

.filter-container {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-lg);
    align-items: flex-start;
    margin-bottom: var(--spacing-md);
}

.filter-group {
    flex: 1;
    min-width: 200px;
}

.filter-group label {
    display: block;
    margin-bottom: var(--spacing-sm);
    font-weight: 600;
    color: var(--text-color);
    font-size: 0.9375rem;
}

.filter-options {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-sm);
}

.filter-option {
    background: none;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-md);
    padding: 8px 14px;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all var(--transition-fast);
    color: var(--text-secondary);
    font-weight: 500;
}

.filter-option:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
    background-color: rgba(var(--primary-rgb), 0.05);
}

.filter-option.active {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
    box-shadow: 0 2px 8px rgba(var(--primary-rgb), 0.3);
}

.sort-select {
    padding: 10px 14px;
    border-radius: var(--border-radius-md);
    border: 1px solid var(--border-color);
    background-color: var(--background-color);
    font-size: 0.875rem;
    color: var(--text-color);
    cursor: pointer;
    transition: all var(--transition-fast);
    background-image: url('../images/icons/chevron-down.svg');
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 14px;
    padding-right: 36px;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

.sort-select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(var(--primary-rgb), 0.15);
}

/* 标签筛选 */
.tag-filters {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-md);
}

.tag-label {
    font-weight: 600;
    color: var(--text-color);
    font-size: 0.9375rem;
}

.tags {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-sm);
}

.tag-btn {
    background: none;
    border: none;
    padding: 6px 12px;
    font-size: 0.875rem;
    cursor: pointer;
    color: var(--text-secondary);
    border-radius: var(--border-radius-md);
    transition: all var(--transition-fast);
}

.tag-btn:hover {
    color: var(--primary-color);
    background-color: rgba(var(--primary-rgb), 0.05);
}

.tag-btn.active {
    color: var(--primary-color);
    background-color: rgba(var(--primary-rgb), 0.1);
    font-weight: 500;
}

/* 筛选结果统计 */
.filter-results {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: var(--spacing-md);
    border-top: 1px solid var(--border-color);
}

.results-count {
    font-size: 0.9375rem;
    color: var(--text-secondary);
}

.results-count strong {
    color: var(--text-color);
    font-weight: 600;
}

.clear-filters-btn {
    background: none;
    border: none;
    color: var(--primary-color);
    font-size: 0.875rem;
    cursor: pointer;
    padding: 6px 12px;
    border-radius: var(--border-radius-md);
    transition: all var(--transition-fast);
}

.clear-filters-btn:hover {
    background-color: rgba(var(--primary-rgb), 0.1);
    text-decoration: underline;
}

/* 模板网格 */
.templates-grid {
    padding: var(--spacing-xl) 0 var(--spacing-xxl);
    background-color: var(--background-secondary);
}

.templates-container {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--spacing-xl);
    margin-bottom: var(--spacing-xl);
}

.template-card {
    background-color: var(--background-color);
    border-radius: var(--border-radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-md);
    transition: transform var(--transition-normal), box-shadow var(--transition-normal);
    position: relative;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.template-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.template-preview {
    position: relative;
    height: 400px;
    overflow: hidden;
    background-color: var(--background-secondary);
}

.template-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--transition-normal);
}

.template-card:hover .template-preview img {
    transform: scale(1.05);
}

.template-actions {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: var(--spacing-md);
    background: linear-gradient(to top, rgba(0, 0, 0, 0.7), transparent);
    display: flex;
    gap: var(--spacing-sm);
    opacity: 0;
    transform: translateY(20px);
    transition: opacity var(--transition-normal), transform var(--transition-normal);
}

.template-card:hover .template-actions {
    opacity: 1;
    transform: translateY(0);
}

.template-actions .btn {
    flex: 1;
    font-size: 0.875rem;
    padding: 8px 12px;
    backdrop-filter: blur(4px);
}

.template-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    padding: 6px 10px;
    border-radius: var(--border-radius-md);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    z-index: 1;
    box-shadow: var(--shadow-sm);
}

.template-badge.free {
    background-color: var(--success-color);
    color: white;
}

.template-badge.premium {
    background-color: var(--warning-color);
    color: white;
}

.template-info {
    padding: var(--spacing-lg);
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.template-info h3 {
    margin-bottom: var(--spacing-xs);
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-color);
}

.template-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
    padding-top: var(--spacing-md);
}

.template-rating {
    display: flex;
    align-items: center;
    gap: 6px;
}

.stars {
    display: flex;
    align-items: center;
}

.star {
    width: 16px;
    height: 16px;
    background-image: url('../images/icons/star-empty.svg');
    background-size: contain;
    background-repeat: no-repeat;
    margin-right: 2px;
}

.star.filled {
    background-image: url('../images/icons/star-filled.svg');
}

.star.half {
    background-image: url('../images/icons/star-half.svg');
}

.rating-value {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-color);
}

.template-downloads {
    display: flex;
    align-items: center;
    gap: 4px;
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.download-icon {
    width: 16px;
    height: 16px;
    background-image: url('../images/icons/download.svg');
    background-size: contain;
    background-repeat: no-repeat;
}

.template-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: var(--spacing-sm);
}

.template-tags .tag {
    font-size: 0.75rem;
    padding: 4px 8px;
    border-radius: var(--border-radius-sm);
    background-color: var(--background-secondary);
    color: var(--text-secondary);
}

/* 加载更多按钮 */
.load-more {
    text-align: center;
    margin-top: var(--spacing-xl);
    margin-bottom: var(--spacing-xl);
}

.load-more-btn {
    background-color: transparent;
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
    padding: 12px 24px;
    border-radius: var(--border-radius-md);
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.load-more-btn:hover {
    background-color: var(--primary-color);
    color: white;
}

/* 模板预览模态框 */
.template-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    visibility: hidden;
    opacity: 0;
    transition: visibility 0s linear 0.3s, opacity 0.3s;
}

.template-modal.active {
    visibility: visible;
    opacity: 1;
    transition-delay: 0s;
}

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.template-modal.active .modal-overlay {
    opacity: 1;
}

.modal-container {
    position: relative;
    width: 90%;
    max-width: 1000px;
    max-height: 90vh;
    background-color: var(--background-color);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-xl);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    z-index: 1001;
    transform: translateY(-20px);
    transition: transform 0.3s ease-out;
}

.template-modal.active .modal-container {
    transform: translateY(0);
}

.modal-header {
    padding: var(--spacing-lg);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin: 0;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-secondary);
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all var(--transition-fast);
}

.modal-close:hover {
    background-color: var(--background-secondary);
    color: var(--text-color);
}

.modal-content {
    padding: var(--spacing-lg);
    overflow-y: auto;
    display: flex;
    gap: var(--spacing-xl);
}

.template-preview-large {
    flex: 1;
    max-width: 50%;
    border-radius: var(--border-radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-md);
}

.template-preview-large img {
    width: 100%;
    height: auto;
    display: block;
}

.template-details {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: var(--spacing-lg);
}

.template-description h3,
.template-features h3 {
    font-size: 1.125rem;
    margin-bottom: var(--spacing-sm);
    font-weight: 600;
}

.template-features ul {
    padding-left: var(--spacing-lg);
    margin: 0;
}

.template-features li {
    margin-bottom: var(--spacing-xs);
    color: var(--text-secondary);
}

.template-meta-large {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-lg);
    padding-top: var(--spacing-md);
    border-top: 1px solid var(--border-color);
}

.meta-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.meta-label {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.meta-value {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-color);
}

.stars-large {
    display: flex;
    align-items: center;
}

.stars-large .star {
    width: 20px;
    height: 20px;
}

.modal-footer {
    padding: var(--spacing-lg);
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: var(--spacing-md);
}

/* 会员升级提示模态框 */
.upgrade-container {
    max-width: 800px;
}

.upgrade-content {
    display: flex;
    gap: var(--spacing-xl);
}

.upgrade-image {
    flex: 1;
    max-width: 40%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.upgrade-image img {
    max-width: 100%;
    height: auto;
}

.upgrade-info {
    flex: 1;
}

.upgrade-info h3 {
    font-size: 1.25rem;
    margin-bottom: var(--spacing-md);
    font-weight: 600;
}

.benefits-list {
    padding-left: 0;
    margin-bottom: var(--spacing-lg);
}

.benefits-list li {
    position: relative;
    padding-left: 28px;
    margin-bottom: var(--spacing-sm);
    list-style: none;
}

.benefits-list li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 4px;
    width: 18px;
    height: 18px;
    background-image: url('../images/icons/check-circle.svg');
    background-size: contain;
    background-repeat: no-repeat;
}

.membership-options {
    display: flex;
    gap: var(--spacing-md);
    margin-top: var(--spacing-lg);
}

.membership-option {
    flex: 1;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-md);
    padding: var(--spacing-md);
    position: relative;
}

.membership-option.recommended {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(var(--primary-rgb), 0.1);
}

.option-badge {
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    background-color: var(--primary-color);
    color: white;
    padding: 4px 12px;
    border-radius: var(--border-radius-md);
    font-size: 0.75rem;
    font-weight: 600;
}

.option-header {
    text-align: center;
    margin-bottom: var(--spacing-md);
}

.option-header h4 {
    margin-bottom: var(--spacing-xs);
    font-size: 1.125rem;
}

.price {
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 4px;
    margin-bottom: 4px;
}

.amount {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-color);
}

.period {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.price-original {
    font-size: 0.875rem;
    color: var(--text-secondary);
    text-decoration: line-through;
}

.price-save {
    font-size: 0.875rem;
    color: var(--success-color);
    font-weight: 600;
    margin-top: 4px;
}

.btn-block {
    width: 100%;
}

.upgrade-note {
    text-align: center;
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin: 0;
}

.upgrade-note a {
    color: var(--primary-color);
    text-decoration: none;
}

.upgrade-note a:hover {
    text-decoration: underline;
}

.template-rating {
    display: flex;
    align-items: center;
    gap: 4px;
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.template-rating img {
    width: 16px;
    height: 16px;
}

/* 分页 */
.pagination {
    display: flex;
    justify-content: center;
    gap: var(--spacing-sm);
}

.pagination-btn {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--border-radius-md);
    border: 1px solid var(--border-color);
    background-color: var(--background-color);
    cursor: pointer;
    transition: all var(--transition-fast);
    font-weight: 500;
}

.pagination-btn:hover:not(:disabled) {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.pagination-btn.active {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

.pagination-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.pagination-btn img {
    width: 16px;
    height: 16px;
}

.pagination-ellipsis {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    color: var(--text-secondary);
}

/* Toast提示 */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    padding: 12px 20px;
    border-radius: var(--border-radius-md);
    color: white;
    font-size: 0.9375rem;
    font-weight: 500;
    box-shadow: var(--shadow-lg);
    opacity: 0;
    transform: translateY(-20px);
    transition: opacity 0.3s, transform 0.3s;
    max-width: 350px;
}

.toast.show {
    opacity: 1;
    transform: translateY(0);
}

.toast-success {
    background-color: var(--success-color);
}

.toast-error {
    background-color: var(--error-color);
}

.toast-warning {
    background-color: var(--warning-color);
}

.toast-info {
    background-color: var(--primary-color);
}

/* 加载状态 */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255, 255, 255, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    opacity: 1;
    transition: opacity 0.3s;
}

.loading-overlay.fade-out {
    opacity: 0;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 5px solid rgba(var(--primary-rgb), 0.2);
    border-radius: 50%;
    border-top-color: var(--primary-color);
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 响应式调整 */
@media (max-width: 1024px) {
    .templates-container {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .filter-container {
        flex-direction: column;
        align-items: stretch;
        gap: var(--spacing-md);
    }
    
    .filter-group {
        width: 100%;
    }
    
    .modal-content {
        flex-direction: column;
    }
    
    .template-preview-large {
        max-width: 100%;
        margin-bottom: var(--spacing-lg);
    }
    
    .upgrade-content {
        flex-direction: column;
    }
    
    .upgrade-image {
        max-width: 100%;
        margin-bottom: var(--spacing-lg);
    }
}

@media (max-width: 768px) {
    .page-header h1 {
        font-size: 2rem;
    }
    
    .template-filters {
        position: static;
    }
    
    .filter-container {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .filter-group {
        margin-bottom: var(--spacing-md);
        width: 100%;
    }
    
    .sort-select-container {
        width: 100%;
        margin-top: var(--spacing-md);
    }
    
    .sort-select {
        width: 100%;
    }
    
    .tag-filters {
        flex-wrap: wrap;
    }
    
    .membership-options {
        flex-direction: column;
        gap: var(--spacing-lg);
    }
    
    .membership-option.recommended {
        margin-top: var(--spacing-xl);
    }
}

@media (max-width: 480px) {
    .templates-container {
        grid-template-columns: 1fr;
    }
    
    .page-header h1 {
        font-size: 1.75rem;
    }
    
    .pagination-btn {
        width: 36px;
        height: 36px;
        font-size: 0.875rem;
    }
    
    .template-preview {
        height: 300px;
    }
    
    .modal-container {
        width: 95%;
    }
    
    .modal-header {
        padding: var(--spacing-md);
    }
    
    .modal-content {
        padding: var(--spacing-md);
    }
    
    .modal-footer {
        padding: var(--spacing-md);
        flex-direction: column;
        gap: var(--spacing-sm);
    }
    
    .modal-footer .btn {
        width: 100%;
    }
}